package com.example.wujinapi.controller;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.example.wujinapi.comm.R;
import com.example.wujinapi.entity.Firsttype;
import com.example.wujinapi.entity.wxDecryptPhoneUser;
import com.example.wujinapi.service.FirsttypeService;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;
import java.io.Serializable;
import java.util.List;

/**
 * (Firsttype)表控制层
 *
 * @author makejava
 * @since 2023-07-15 17:33:52
 */
@RestController
@RequestMapping("firsttype/")
public class FirsttypeController extends ApiController {
    /**
     * 服务对象
     */
    @Resource
    private FirsttypeService firsttypeService;


    /**
     * 获取主类目
     */
    @GetMapping("/getFirst")
    public R getFirst()  {
        try{
            List<Firsttype> firsttypes = firsttypeService.getFirsttypes();
            return R.ok("成功").put("data",firsttypes);
        }catch(Exception ex){
            System.out.println(ex.getMessage());
            return R.error("失败");
        }
    }
}

